package com.tmp.alarm.task;

import java.sql.Connection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tmp.alarm.utils.FileUtil;
import com.tmp.alarm.utils.MySQLUtils;
import com.tmp.alarm.utils.PropertiesUtil;

public class MartMobilebuffaloLog {
	private final static Logger log = LoggerFactory.getLogger(MartMobilebuffaloLog.class);
	public static void insertBuffaloInfo2Mysql(){
		String filepath = PropertiesUtil.get("buffaloLog.dir");
		String insertSql = PropertiesUtil.get("buffaloLog.insert.sql");
		try {
			Connection conn = MySQLUtils.getConnection();
			log.info("获取的connection对象：" + conn);
			FileUtil.readFileInsertMysqlThenDel(filepath, insertSql, conn);
//			MySQLUtils.returnConnection(conn);
			MySQLUtils.close(conn);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
	}
}
